#include <future>
#include <string>
#include <thread>
#include <iostream>

void print(std::promise<std::string>& p)
{
	p.set_value("There is the result whitch you want.");
}

void do_some_other_things()
{
	std::cout << "Hello World" << std::endl;
}

int main()
{
	std::promise<std::string> promise;

	std::future<std::string> result = promise.get_future();
	std::thread t(print, std::ref(promise));
	do_some_other_things();
	std::cout << result.get() << std::endl;
	t.join();
	return 0;
}
